load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "install",
    srcs = [
        "cluster_settings.go",
        "cluster_synced.go",
        "cockroach.go",
        "download.go",
        "expander.go",
        "install.go",
        "iterm2.go",
        "nodes.go",
        "run_options.go",
        "services.go",
        "session.go",
        "staging.go",
    ],
    embedsrcs = [
        "files/cockroachdb-logging.yaml",
        "scripts/download.sh",
        "scripts/start.sh",
        "scripts/open_ports.sh",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/roachprod/install",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/roachprod/cloud",
        "//pkg/roachprod/config",
        "//pkg/roachprod/errors",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/ssh",
        "//pkg/roachprod/ui",
        "//pkg/roachprod/vm",
        "//pkg/roachprod/vm/aws",
        "//pkg/roachprod/vm/gce",
        "//pkg/roachprod/vm/local",
        "//pkg/testutils",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_alessio_shellescape//:shellescape",
        "@com_github_cockroachdb_errors//:errors",
        "@org_golang_x_exp//maps",
        "@org_golang_x_sync//errgroup",
        "@org_golang_x_sys//unix",
    ],
)

go_test(
    name = "install_test",
    srcs = [
        "cluster_synced_test.go",
        "cockroach_test.go",
        "services_test.go",
        "staging_test.go",
        "start_template_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":install"],
    deps = [
        "//pkg/roachprod/cloud",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/vm",
        "//pkg/roachprod/vm/gce/testutils",
        "//pkg/roachprod/vm/local",
        "//pkg/testutils/datapathutils",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
